CREATE TABLE [dbo].[TDORDE_FACT]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[CO_TIPO_DOCU] [dbo].[TD_VC_003] NOT NULL,
[NU_DOCU_PROV] [dbo].[TD_VC_020] NOT NULL,
[NU_CORR] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDORDE_FA__NU_CO__0FD74C44] DEFAULT ((0)),
[CO_UNID] [dbo].[TD_VC_003] NULL,
[TI_DOCU_ORIG] [dbo].[TD_VC_003] NULL,
[CO_ALMA] [dbo].[TD_VC_003] NULL,
[NU_DOCU_ORIG] [dbo].[TD_VC_020] NULL,
[TI_DOCU_GUIN] [dbo].[TD_VC_003] NULL,
[NU_DOCU_GUIN] [dbo].[TD_VC_020] NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[IM_DOCU_ORIG] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDORDE_FA__IM_DO__10CB707D] DEFAULT ((0)),
[IM_CONV] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDORDE_FA__IM_CO__11BF94B6] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDORDE_FA__CO_US__12B3B8EF] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDORDE_FA__FE_US__13A7DD28] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDORDE_FA__CO_US__149C0161] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDORDE_FA__FE_US__1590259A] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDORDE_FACT] ADD CONSTRAINT [PK__TDORDE_F__CBFE09750B087586] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_PROV], [CO_TIPO_DOCU], [NU_DOCU_PROV], [NU_CORR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDORDE_FACT] ADD CONSTRAINT [FK__TDORDE_FACT__62E57593] FOREIGN KEY ([CO_EMPR], [CO_PROV], [CO_TIPO_DOCU], [NU_DOCU_PROV]) REFERENCES [dbo].[TMDOCU_PROV] ([CO_EMPR], [CO_PROV], [CO_TIPO_DOCU], [NU_DOCU_PROV])
GO
